package com.cy.sapling.search.hystrix;

import com.cy.sapling.search.entity.Goods;
import com.cy.sapling.search.service.GoodsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/11/21.
 */
@Component
public class GoodsServiceHystrix implements GoodsService {
    private static final Logger LOGGER = LoggerFactory.getLogger(GoodsServiceHystrix.class);
    @Override
    public Goods goodsById(@PathVariable("id") Long id) {
        LOGGER.info("goodsById -> 接口已经出现熔断");
        return new Goods();
    }

    @Override
    public List<Goods> getAllList() {
        LOGGER.info("goodsById -> 接口已经出现熔断");
        return new ArrayList<>();
    }
}
